package academic.emailClient.control.listeners;

import java.util.ArrayList;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import academic.emailClient.model.EmailClientModel;
import academic.emailClient.model.entities.Meeting;
import academic.emailClient.view.EmailClientViewInterface;

public class ModifyMeetingTabChangedListener implements ChangeListener{
	EmailClientViewInterface view;
	EmailClientModel model;
	
	/**
	 * Constructor
	 */
	
	public ModifyMeetingTabChangedListener(EmailClientViewInterface view, EmailClientModel model){
		this.model = model;
		this.view = view;
	}
	
	/**
	 * Handle Modify Meeting Tab Changed event
	 */
	@Override
	public void stateChanged(ChangeEvent arg0) {
		// Load the Meetings cb
		ArrayList<Meeting> meetings = new ArrayList<Meeting>(model.getMeetings().values());
		view.loadModifyMeetingsCb(meetings);
	}

}

